﻿<%@ Page Title="" Language="C#" MasterPageFile="~/ActivitySystemDefaultPage.Master" AutoEventWireup="true" CodeBehind="List.aspx.cs" Inherits="ActivitySystem.Web.Activity.List" %>

<%@ Register Assembly="Sunyi.Project.WebPoint.WebControl" Namespace="Sunyi.Project.WebPoint.WebControl" TagPrefix="cc1" %>
<asp:Content ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        #div_content_searchresult table
        {
            border: 1px;
        }
        #div_content_searchbar input
        {
            width: 100px;
        }
    </style>
</asp:Content>
<asp:Content ContentPlaceHolderID="MainContent" runat="server">
    <asp:ScriptManager ID="scriptManager" runat="server" />
    <asp:UpdatePanel ID="updatePanel" runat="server">
        <ContentTemplate>
            <div id="div_content">
                <div id="div_content_searchbar">
                    <span>Type:</span><asp:DropDownList ID="ddlActivityType" runat="server" />
                    <span>Title:</span><asp:TextBox ID="tbxTitle" runat="server" />
                    <span>Hosted by:</span><asp:TextBox ID="tbxHostedBy" runat="server" />
                    <span>Date:</span><asp:TextBox ID="tbxStartTime" runat="server" />
                    <asp:Button ID="btnSearch" runat="server" Text="Search" OnClick="btnSearch_Click" />
                    <asp:HyperLink NavigateUrl="~/Activity/Host.aspx" Text="Host Activity!" Target="_blank" runat="server" />
                </div>
                <div id="div_content_searchresult" style="margin-top: 15px;">
                    <cc1:PagingGridView ID="gvActivity" runat="server" AutoGenerateColumns="False" 
                        AllowPaging="True" OnPageIndexChanging="gvAuditLog_PageIndexChanging" 
                        PageSize="20" Width="100%">
                        <Columns>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    Title
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="lblTitle" runat="server" Text='<%# Bind("Title") %>' Visible="false" />
                                    <a href='View.aspx?ActivityId=<%# Eval("Id") %>&Mode=read' target="_blank">
                                        <%# Eval("Title") %></a>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="Launcher" HeaderText="Launcher" />
                            <asp:BoundField DataField="Type" HeaderText="Type" />
                            <asp:BoundField DataField="UserCount" HeaderText="Participants" />
                            <asp:BoundField DataField="StartTime" HeaderText="Start Time" />
                            <asp:BoundField DataField="EndTime" HeaderText="End Time" />
                        </Columns>
                        <HeaderStyle BackColor="#546E96" ForeColor="#DFDFDF" />
                    </cc1:PagingGridView>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
